//package com.daocao.hua.adapter;
//
//import android.content.Context;
//import android.text.TextUtils;
//import android.view.View;
//import android.widget.TextView;
//
//import com.daocao.hua.R;
//
//import com.daocao.hua.adapter.base.BaseRViewSubAdapter;
//import com.daocao.hua.adapter.base.BaseViewHolder;
//import com.daocao.hua.interfaces.OnRecyclerViewListener;
//import com.daocao.hua.model.RepayRecordModel;
//import com.daocao.hua.util.DateTime;
//import com.daocao.hua.util.GlideUtils;
//import com.daocao.hua.util.ToastUtil;
//import com.daocao.hua.util.UI;
//import com.daocao.hua.view.Dialog;
//
//import java.util.List;
//
//
///**
// * 还款记录
// * Created by MasterDong on 16/4/12.
// */
//
//public class RepayRecordAdapterNew extends BaseRViewSubAdapter<RepayRecordModel.Data> {
//    private Context context;
//
//    private OnRecyclerViewListener onRecyclerViewListener;
//
//    public void setOnRecyclerViewListener(OnRecyclerViewListener onRecyclerViewListener) {
//        this.onRecyclerViewListener = onRecyclerViewListener;
//
//    }
//
//
//    private List<RepayRecordModel.Data> list;
//
//    public RepayRecordAdapterNew(Context context, List<RepayRecordModel.Data> list) {
//        super(context, R.layout.repay_list_items, list);
//        this.list = list;
//        this.context = context;
//    }
//
//
//    @Override
//    protected void convert(final BaseViewHolder viewHoder, RepayRecordModel.Data item, final int position) {
//        final RepayRecordModel.Data mode = item;
//
//        View tvCheckIng = viewHoder.getView(R.id.tvCheckIng);
//        View tvCheckFailed = viewHoder.getView(R.id.tvCheckFailed);
//        View tvhaveCheck = viewHoder.getView(R.id.tvhaveCheck);
//        View tvCheckCancel = viewHoder.getView(R.id.tvCheckCancel);
//        viewHoder.getTextView(R.id.date).setText(DateTime.toDateTime(mode.getCreate_time() * 1000));
//
//        viewHoder.getTextView(R.id.txt_offline_paymoney).setText("￥" + mode.getOrder_money().replace(".00", ""));
//        viewHoder.getTextView(R.id.txt_offline_shishou).setText("￥" + mode.getMoney().replace(".00", ""));
//        viewHoder.getTextView(R.id.txt_offline_dikou).setText("￥" + mode.offset_money.replace(".00", ""));
//        viewHoder.getTextView(R.id.txt_offline_youhui).setText("￥" + mode.coupon_money.replace(".00", ""));
//        viewHoder.getTextView(R.id.type).setText(mode.payment_name);
//        if (!TextUtils.isEmpty(mode.getFailed_reason())) {
//            viewHoder.getTextView(R.id.txt_fail_reason).setText(mode.getFailed_reason());
//        }
//
//        if (mode.online_pay == 1) {
////            1：线上支付
//            if (mode.getIs_paid() == 1) {
////                1：成功
//                tvCheckCancel.setVisibility(View.GONE);
//                tvCheckIng.setVisibility(View.GONE);
//                tvCheckFailed.setVisibility(View.GONE);
//                tvhaveCheck.setVisibility(View.VISIBLE);
//                viewHoder.getTextView(R.id.txt_offline_status).setTextColor(0xff6ccd3b);
//                viewHoder.getTextView(R.id.txt_offline_status).setText("已通过");
//            } else {
////                其他：失败
//                tvCheckCancel.setVisibility(View.VISIBLE);
//                tvCheckIng.setVisibility(View.GONE);
//                tvCheckFailed.setVisibility(View.GONE);
//                tvhaveCheck.setVisibility(View.GONE);
//                viewHoder.getTextView(R.id.txt_offline_status).setTextColor(0xff888888);
//                viewHoder.getTextView(R.id.txt_offline_status).setText("已取消");
//            }
//            viewHoder.getImageView(R.id.repay_v_image).setVisibility(View.INVISIBLE);
////            viewHoder.getTextView(R.id.txt_date_online).setText(DateTime.toDateTime(mode.getCreate_time() * 1000));
////            viewHoder.getTextView(R.id.txt_pay_money_online).setText("￥" + mode.getMoney());
////            UI.setTvHtml(viewHoder.getTextView(R.id.txt_dikou_online), R.string.pay_record_text, mode.offset_money, mode.coupon_money);
//        } else {
////            线下支付
//
//            viewHoder.getImageView(R.id.repay_v_image).setVisibility(View.VISIBLE);
//            GlideUtils.loadImageRound(context, viewHoder.getImageView(R.id.repay_v_image), mode.getPhoto());
//
//            viewHoder.getImageView(R.id.repay_v_image).
//                    setOnClickListener(new View.OnClickListener() {
//                        @Override
//                        public void onClick(View v) {
//                            if (mode.getPhoto() != null) {
//                                Dialog.showRecordImage(context, mode.getPhoto());
//                            } else {
//                                ToastUtil.makeText(context, "暂无凭证图片", 2).show();
//                            }
//                        }
//                    });
//
//            if (mode.getIs_paid() == 0 && mode.getIs_failed() == 0) {//审核中
//                tvCheckIng.setVisibility(View.VISIBLE);
//                tvCheckFailed.setVisibility(View.GONE);
//                tvCheckCancel.setVisibility(View.GONE);
//                tvhaveCheck.setVisibility(View.GONE);
//                viewHoder.getTextView(R.id.txt_offline_status).setTextColor(0xfff9a016);
//                viewHoder.getTextView(R.id.txt_offline_status).setText("审核中");
//            } else if (mode.getIs_failed() == 1) {//审核失败
//                tvCheckIng.setVisibility(View.GONE);
//                tvCheckFailed.setVisibility(View.VISIBLE);
//                tvhaveCheck.setVisibility(View.GONE);
//                tvCheckCancel.setVisibility(View.GONE);
//                viewHoder.getTextView(R.id.txt_offline_status).setTextColor(0xfff86667);
//                viewHoder.getTextView(R.id.txt_offline_status).setText("未通过");
//            } else if (mode.getIs_failed() == 0) {//审核成功
//                tvCheckIng.setVisibility(View.GONE);
//                tvCheckFailed.setVisibility(View.GONE);
//                tvCheckCancel.setVisibility(View.GONE);
//                tvhaveCheck.setVisibility(View.VISIBLE);
//                viewHoder.getTextView(R.id.txt_offline_status).setTextColor(0xff6ccd3b);
//                viewHoder.getTextView(R.id.txt_offline_status).setText("已通过");
//            }
//
//
//
//
//            View rootView = viewHoder.getView(R.id.repay_list_item);
//            rootView.setOnClickListener(new View.OnClickListener()
//
//            {
//                @Override
//                public void onClick(View v) {
//                    if (null != onRecyclerViewListener) {
//                        onRecyclerViewListener.onItemClick(list, position);
//                    }
//                }
//            });
//            rootView.setOnLongClickListener(new View.OnLongClickListener()
//
//            {
//                @Override
//                public boolean onLongClick(View v) {
//                    if (null != onRecyclerViewListener) {
//                        return onRecyclerViewListener.onItemLongClick(list, position);
//                    }
//                    return false;
//                }
//            });
//        }
//
//
//    }
//
//
//}
//
